﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Rule.aspx.cs" Inherits="bianzhuo.SupportPlatform.BzBusiness.Manage.Rule" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>商家管理</title>
    <link href="/BzBusiness/css/style2.css" rel="stylesheet" type="text/css" />
    <script src="/BzBusiness/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <style>
        .user_list {
            margin-top: 15px;
        }

            .user_list th {
                font-weight: 400;
            }

            .user_list td {
                height: 38px;
                line-height: 38px;
            }

                .user_list td input {
                    margin-right: 5px;
                    vertical-align: middle;
                    margin-bottom: 3px;
                }

        .qx_list li {
            width: 25%;
            float: left;
            height: 80px;
            line-height: 40px;
            color: #888;
            border-right: 1px #e3e3e3 solid;
            box-sizing: border-box;
            border-top: 1px #e3e3e3 solid;
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="content">
            <ul class="breadcrumb">
                <li><a href="../BusinessHome.aspx">首页</a> <span class="divider">/</span></li>
                <li class="active">商家管理员权限设置</li>
            </ul>
            <div class="container">
                <div class="qxset_div">
                    <ul>
                        <%for (int i = 0; i < wxlist.Count; i++)
                            { %>
                        <%if (wxlist[i].MicroId.ToString() == "1")
                            { %>
                        <%if (MicroId == wxlist[i].MicroId.ToString())
                            { %>
                        <li class="dqbg"><%=wxlist[i].MicroName %></li>
                        <%}
                            else
                            {%><li><a href="?wxID=<%=wxlist[i].MicroId%>&AdminId=<%=Request["AdminId"] %><%=string.IsNullOrWhiteSpace(Request["RuleId"]) ? "" : ("&RuleId=" + Request["RuleId"]) %>"><%=wxlist[i].MicroName %></a></li>
                        <%}
                                }
                            } %>
                    </ul>
                </div>

                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">基础功能权限</p>
                            <p class="qxset_qx"><font><input type="checkbox" class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">设置微网站、微商城、微信回复、群发、菜单等</ul>
                        </th>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">

                                <%if (wx.WxAdvancedAPI > 0)
                                    { %>
                                <li>
                                    <input type="checkbox" name="rule" value="wxmodify" />公众号配置</li>
                                <li>
                                    <input type="checkbox" name="rule" value="settingreplyaudio,settingreplyaudiocreate,settingreplyaudiomodify,settingreplyauto,settingreplycreate,settingreplydefault,settingreplylbs,settingreplylbscreate,settingreplylbsmodify,settingreplymodify,settingreplypictrue,settingreplypictruecreate,settingreplypictruemodify,settingreplyvideo,settingreplyvideocreate,settingreplyvideomodify" />微信关键词回复</li>
                                <li>
                                    <input type="checkbox" name="rule" value="wxmenu" />微信菜单设置</li>
                                <li>
                                    <input type="checkbox" name="rule" value="wxfansdefaults,webmessagesendtouser" />粉丝管理</li>
                                <%--<li>
                                    <input type="checkbox" name="rule" value="messagedefault" />消息管理</li>--%>
                                <%} %>
                            </ul>
                        </td>
                    </tr>

                </table>

                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">辅助权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"   class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">设置其他辅助功能</ul>
                        </th>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">
                                <%--   <li>
                                    <input type="checkbox" name="rule" value="paymentlistmanager,addpayment" />支付方式</li>
                                <li>
                                    <input type="checkbox" name="rule" value="membershare,memberpromote" />分享/邀请活动规则</li>
                                <li>
                                    <input type="checkbox" name="rule" value="sign_rule" />积分签到规则</li>--%>
                                <%if (wx.WxAdvancedAPI == 1)
                                    { %>
                                <li>
                                    <input type="checkbox" name="rule" value="tempmessageset" />模版消息设置</li>
                                <%} %>
                            </ul>
                        </td>
                    </tr>

                </table>

                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">监理网系统功能</p>
                            <p class="qxset_qx"><font><input type="checkbox"   class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">设置房屋装修监理网系统功能</ul>
                        </th>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">
                                <li>
                                    <input type="checkbox" name="rule" value="userlist,useredit,userview,userpoint,userpointlog" />用户管理</li>                                
                                <li>
                                    <input type="checkbox" name="rule" value="messagelist,messageedit" />消息管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="projectlist,projectedit,steplist,stepedit" />预约项目</li>
                                <li>
                                    <input type="checkbox" name="rule" value="supervisionlist,supervisionedit,superstepedit,supersteplist" />监理项目管理</li>

                                <li>
                                    <input type="checkbox" name="rule" value="jlyfabiaoanlie,jlybianjianlie,jlyfabiaoanlie2,jlyfabiaoanlie1" />监理项目编辑</li>
                                <li>
                                    <input type="checkbox" name="rule" value="caselist,caseedit,caselogedit,casesetplist,casesetpedit" />监理案例管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="previewlist,previewedit" />预览案例管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="commentslist,commentschildlist,commentsedit" />评论管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="allowlist" />申请管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="applylist,applyedit" />预约管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="activelist,activeedit,templatelist,templateformlist,templateformedit" />最新活动</li>
                                <li>
                                    <input type="checkbox" name="rule" value="questioncategorylist,questioncategoryedit" />问题分类</li>
                                <li>
                                    <input type="checkbox" name="rule" value="raiderslist,raidersedit" />装修经验、装修问答</li>
                                <li>
                                    <input type="checkbox" name="rule" value="vediolist,vedioedit" />维权视频</li>
                                <li>
                                    <input type="checkbox" name="rule" value="zxyuyuelist,zxyuyueedit" />预约列表</li>
                                <li>
                                    <input type="checkbox" name="rule" value="companylist,companyedit" />风险规避</li>
                                <li>
                                    <input type="checkbox" name="rule" value="supervisioncompanylist,supervisioncompanyedit" />监理公司</li>
                                <li>
                                    <input type="checkbox" name="rule" value="supervisorlevellist,supervisorleveledit" />监理员级别</li>
                                <li>
                                    <input type="checkbox" name="rule" value="doormodellist,doormodeledit" />户型管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="arealist,areaedit" />区域管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="chatinglist,chatingedit" />消息字典</li>
                                <li>
                                    <input type="checkbox" name="rule" value="pointruleset" />积分规则</li>
                                <li>
                                    <input type="checkbox" name="rule" value="bannerlist,banneredit" />Banner管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="templateset,indexphoneanddesc,linklist" />公司介绍、监理服务页、家装监理页、监理服务导航、监理案例页底部、首页文字电话、友情链接管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="keywordsset" />关键词设置</li>
                            </ul>
                        </td>
                    </tr>

                </table>

                <%if (reslist.Count > 0 && funclist.Exists(r => r.FunctionID == 22))
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">餐饮行业权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"   class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">订单管理：查看和处理该分店订单;&nbsp;&nbsp;扫描二维码：微种子助手可以扫描该分店活动二维码。</ul>
                        </th>
                    </tr>

                    <tr>
                        <td colspan="4" align="center" class="border_left">
                            <%for (int i = 0; i < reslist.Count; i++)
                                { %>
                            <ul class="qx_list">
                                <li><%=reslist[i].RestaurantName %></li>
                                <li>
                                    <input type="checkbox" name="rule" value="餐饮分店_<%=reslist[i].RestaurantId %>" />分店管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="餐饮订单_<%=reslist[i].RestaurantId %>" />订单管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="餐饮扫描_<%=reslist[i].RestaurantId %>" />扫描二维码</li>
                            </ul>
                            <%} %>                       
                        </td>
                    </tr>

                </table>
                <%} %>

                <%if (hotellist.Count > 0 && funclist.Exists(r => r.FunctionID == 3))
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">酒店行业权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"   class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">订单管理：查看和处理该分店订单;&nbsp;&nbsp;扫描二维码：微种子助手可以扫描该分店活动二维码。</ul>
                        </th>
                    </tr>

                    <tr>
                        <td colspan="4" align="center" class="border_left"><%for (int i = 0; i < hotellist.Count; i++)
                                                                               { %>
                            <ul class="qx_list">
                                <li><%=hotellist[i].HotelName %></li>
                                <li>
                                    <input type="checkbox" name="rule" value="酒店分店_<%=hotellist[i].HotelId %>" />分店管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="酒店订单_<%=hotellist[i].HotelId %>" />订单管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="酒店扫描_<%=hotellist[i].HotelId %>" />扫描二维码</li>
                            </ul>
                            <%} %>                       
                        </td>
                    </tr>

                </table>
                <%} %>

                <%if (travellist.Count > 0 && funclist.Exists(r => r.FunctionID == 4))
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">旅行社行业权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"   class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">订单管理：查看和处理该分店订单;&nbsp;&nbsp;扫描二维码：微种子助手可以扫描该分店活动二维码。</ul>
                        </th>
                    </tr>

                    <tr>
                        <td colspan="4" align="center" class="border_left"><%for (int i = 0; i < travellist.Count; i++)
                                                                               { %>
                            <ul class="qx_list">
                                <li><%=travellist[i].TravelName %></li>
                                <li>
                                    <input type="checkbox" name="rule" value="旅行社分店_<%=travellist[i].TravelId %>" />分店管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="旅行社订单_<%=travellist[i].TravelId %>" />订单管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="旅行社扫描_<%=travellist[i].TravelId %>" />扫描二维码</li>
                            </ul>
                            <%} %>                       
                        </td>
                    </tr>

                </table>
                <%} %>

                <%if (attrlist.Count > 0 && funclist.Exists(r => r.FunctionID == 5))
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">景点行业权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"   class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">订单管理：查看和处理该分店订单;&nbsp;&nbsp;扫描二维码：微种子助手可以扫描该分店活动二维码。</ul>
                        </th>
                    </tr>

                    <tr>
                        <td colspan="4" align="center" class="border_left"><%for (int i = 0; i < attrlist.Count; i++)
                                                                               { %>
                            <ul class="qx_list">
                                <li><%=attrlist[i].AtName %></li>
                                <li>
                                    <input type="checkbox" name="rule" value="景点分店_<%=attrlist[i].AtId %>" />景点管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="景点订单_<%=attrlist[i].AtId %>" />订单管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="景点扫描_<%=attrlist[i].AtId %>" />扫描二维码</li>
                            </ul>
                            <%} %>                       
                        </td>
                    </tr>

                </table>
                <%} %>
                <%if (wx.WxAdvancedAPI > 0)
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0" style="display: none">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">微种子助手客服权限</p>
                            <p class="qxset_qx"><font><input type="checkbox" class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">管理员在微种子助手上可接收并回复勾选分组的粉丝消息</ul>
                        </th>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">
                                <li>
                                    <input type="checkbox" name="rule" value="chat_left,chat_main,chat_right,chating,index,knowledgecategory,knowledgecategorymodify,knowledgedefault,knowledgeinfo,knowledgeinfomodify,labeldefault,labelmodify,memberdetail,memberlevel,memberpoint,memberrecharge,memberservice,memberservicelist,messagedefault,userorderlog,userpointslog,userrechargeview" />微客服</li>
                                <%for (int i = 0; i < grouplist.Count; i++)
                                    { %>
                                <li>
                                    <input type="checkbox" name="rule" value="usergroup_<%=grouplist[i].GroupId %>" /><%=grouplist[i].GroupName %>(<%=grouplist[i].BusinessID %>)</li>
                                <%} %>
                            </ul>
                        </td>
                    </tr>
                </table>
                <%} %>
                <%if (wx.IsPromot == true)
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">广告管理权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"  class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">设置广告账户充值、查看推广数据</ul>
                        </th>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">
                                <li>
                                    <input type="checkbox" name="rule" value="listings,add_spread,attention,reg_members,involved,involved2,show_listings,details_listings,reg_Members2" />推广管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="recharge" />充值消费</li>
                                <li>
                                    <input type="checkbox" name="rule" value="pay" />账户充值</li>
                                <li>
                                    <input type="checkbox" name="rule" value="wxupdate" />微信续费</li>
                            </ul>
                        </td>
                    </tr>

                </table>
                <%} %>

                <%if (funclist.Exists(r => r.FunctionID == 12))
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th colspan="4" align="left" class="border_left">
                            <p class="mem_zhek2 qxset_jian">会员系统权限</p>
                            <p class="qxset_qx"><font><input type="checkbox"  class="selall" />&nbsp;全选</font></p>
                            <ul class="qxset_desc">设置会员积分规则、会员等级、会员活动功能</ul>
                        </th>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">
                                <li>
                                    <input type="checkbox" name="rule" value="usercardmodify" />会员卡设置</li>
                                <li>
                                    <input type="checkbox" name="rule" value="memberclassdefault,memberclassmodify" />会员等级设置</li>
                                <li>
                                    <input type="checkbox" name="rule" value="memberpackagedefault,memberpackagemodify" />会员套餐设置</li>
                                <li>
                                    <input type="checkbox" name="rule" value="memberpromotionaddfansfreegive,memberpromotioncoupon,memberpromotiondefault,memberpromotiondiscount,memberpromotionfreegive,memberpromotiongoldegg,memberpromotiongoldjgg,memberpromotionmodify,memberpromotionseckill,walls_lottery,walls_manager,memberpromotionwxsq,secondkillordermanager" />促销活动管理</li>
                            </ul>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" class="border_left">
                            <ul class="qx_list">
                                <li>
                                    <input type="checkbox" name="rule" value="userinfodefault,userinfoview,memberlevel,memberpackage,memberpower,userorderlog" />会员管理</li>
                                <li>
                                    <input type="checkbox" name="rule" value="memberrecharge,UserRechargeView" />余额充值/扣款</li>
                                <li>
                                    <input type="checkbox" name="rule" value="memberpoint,UserPointsLog" />积分充值/扣款</li>
                                <%if (funclist.Exists(r => r.FunctionID == 21))
                                    { %>
                                <li>
                                    <input type="checkbox" name="rule" value="addcoremallproductmanager,addpointproducttypemanager,ajaxpage,pointproductmanager,pointproductorderinfo,pointproducttypemanager" />积分商城</li>
                                <%} %>
                            </ul>
                        </td>
                    </tr>
                </table>
                <%} %>





                <%if (admin.IsBoss == true)
                    { %>
                <table class="user_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="center">
                            <button class="btn btn-01">确认保存</button></td>
                    </tr>

                </table>
                <%} %>
            </div>
        </div>
    </form>
    <script>
        var rules = "<%=Rules%>";
        $('.selall').click(function () {
            var selector = $(this).closest('table').find(':checkbox');
            selector.attr('checked', this.checked);
        })

        $('[name=rule]').each(function () {
            if (rules.indexOf(',' + $(this).val() + ',') > -1) {
                $(this).attr('checked', true);

            }

        })
    </script>

</body>
</html>
